<?php
require_once dirname(__FILE__) . '/../../../DbUtils.class.php';
require_once dirname(__FILE__) . '/data.inc.php';
require_once dirname(__FILE__) . '/../../../includes/MiscUtils.class.php';
$myPdo = DbUtils::createPdoInst();

try {
  $payment = new stdClass();
  $payment->track_id = MiscUtils::unique();
  $payment->name = $name;
  $payment->intro_brief = '';
  $payment->status = 1;
  $payment->is_offline = 0;
  $payment->folder = $folder;
  $payment->width = 1000;
  $payment->height = 200;
  $payment->is_custom = 0;
  $payment->order = 0;
  DbUtils::add($myPdo, 'pz_ecom_mthd_payment', $payment);
} catch (PDOException $e) {
  echo $e->getMessage();
  return;
}

try {
  $sql = "CREATE TABLE IF NOT EXISTS `" . TABLE_NAME_PREFIX_PAYMENT . $folder . "_payment`(
           `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
           `track_id` varchar(16) UNIQUE,
           `payment_id` int,
           `is_formal` tinyint(1)
           `account` varchar(64),
           `currency_code` varchar(64),
           `return_link` varchar(128),
           `cancel_link` varchar(128)
          ) ENGINE=MYISAM;";
  $myPdo->exec($sql);
  echo 'Completed Successfully.';
} catch (PDOException $e) {
  echo $e->getMessage();
}
?>